package com.kakarote.oa.service;

import com.alibaba.fastjson.JSONObject;
import com.kakarote.core.entity.BasePage;
import com.kakarote.core.feign.admin.entity.SimpleUser;
import com.kakarote.core.servlet.BaseService;
import com.kakarote.oa.entity.BO.LogBO;
import com.kakarote.oa.entity.BO.LogSaveBO;
import com.kakarote.oa.entity.BO.OaLogExportBO;
import com.kakarote.oa.entity.PO.OaLog;
import com.kakarote.oa.entity.VO.OaBusinessNumVO;
import com.kakarote.oa.entity.VO.OaLogTemplateFieldVO;
import com.kakarote.oa.entity.VO.OaLogVO;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 工作日志表 服务类
 * </p>
 *
 * @author wyq
 * @since 2020-05-15
 */
public interface IOaLogService extends BaseService<OaLog> {

    /**
     * 查询所有字段
     *
     * @return data
     */
    List<OaLogTemplateFieldVO> queryDefaultField(Long configId);


    /**
     * 分页查询日志列表
     *
     * @param bo bo
     * @return com.kakarote.core.entity.BasePage<com.kakarote.oa.entity.VO.OaLogVO>
     * @author jiao sir
     * @date 2021/8/3
     */
    BasePage<OaLogVO> queryLogList(LogBO bo);

    /**
     * 随机获取一条日志欢迎语
     *
     * @return data
     */
    public String getLogWelcomeSpeech();

    /**
     * 查询日志统计信息
     *
     * @return data
     */
    public JSONObject queryLogBulletin();

    /**
     * 查询日志完成情况统计
     */
    public JSONObject queryCompleteStats(Long type);

    public BasePage<JSONObject> queryCompleteOaLogList(LogBO bo);

    public BasePage<SimpleUser> queryIncompleteOaLogList(LogBO bo);

    public void saveAndUpdate(LogSaveBO object);

    public void deleteById(Long logId);

    public BasePage<JSONObject> queryLogBulletinByType(LogBO bo);

    public List<JSONObject> queryLogRecordCount(String logId, Integer today, String sortField, Integer order);

    JSONObject queryById(Long logId);

    public List<Map<String, Object>> export(LogBO logBO);

    /**
     * app某个查询数量功能，没有名称
     */
    public OaBusinessNumVO queryOaBusinessNum();


    /**
     * 查询日志详情
     *
     * @param id 1
     * @return 1
     */
    List<OaLogTemplateFieldVO> information(Long id);

    /**
     * 导出日志
     *
     * @param logBO    1
     * @param response 1
     */
    void exportLog(OaLogExportBO logBO, HttpServletResponse response);

    /**
     * 更换日志关联信息ID
     * @param type 关联类型
     * @param oldId 原ID
     * @param newId 新ID
     */
    void updateLogRelId(Integer type, Long oldId, Long newId);
}
